import App from './App'

import store from '@/static/js/allProjectsStore.js'
import tools from '@/static/js/tools.js'
import publicFn from '@/static/js/publicFn.js'
import moment from 'moment'
import request from '@/static/js/request.js'
import domain from '@/static/js/domain.js'

import api from '@/static/js/api.js'
import rewritingPagesJumpApplication from '@/static/js/jumpMethod.js'
import { publicApplicationMethods } from '@/static/js/https.js'; // 公共方法

Vue.use(publicFn);
Vue.use(tools);
Vue.use(request);
Vue.use(rewritingPagesJumpApplication);
Vue.use(publicApplicationMethods);

Vue.prototype.$application_api = api;
Vue.prototype.$domain = domain;

import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue'
import poster from '@/components/poster/poster.vue'
import qrCode from '@/components/qrCode/qrCode.vue'
import mSkeleton from '@/components/m-skeleton/m-skeleton.vue'
import checkProvince from '@/components/checkProvince/checkProvince.vue'
import defaultModule from '@/components/defaultModule/defaultModule.vue'
import mButton from '@/components/mButton/mButton.vue'

Vue.component('uni-nav-bar', uniNavBar);
Vue.component('poster', poster);
Vue.component('qrCode', qrCode);
Vue.component('m-skeleton', mSkeleton);
Vue.component('checkProvince', checkProvince);
Vue.component('defaultModule', defaultModule);
Vue.component('m-button', mButton);


moment.updateLocale('cn', {
	relativeTime: {
		future: '%s内',
		past: '%s前',
		s: '1分钟',
		m: '1分钟',
		mm: '%d分钟',
		h: '1小时',
		hh: '%d小时',
		d: '1天',
		dd: '%d天',
		M: '1个月',
		MM: '%d个月',
		y: '1年',
		yy: '%d年',
	},
});
Vue.prototype.$moment = moment;

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  store,
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  // .use(store)
  return {
    app
  }
}
// #endif